package com.sun.service.impl;

import com.sun.dao.TagDao;
import com.sun.dto.TagAndAmount;
import com.sun.pojo.Tag;
import com.sun.pojo.Type;
import com.sun.service.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import static org.thymeleaf.util.ObjectUtils.convertToList;

/**
 * @author: glorysun
 * @date: 2020/8/5
 */
@Service
public class TagServiceImpl implements TagService {

    @Autowired
    private TagDao tagDao;

    @Override
    public int insertTag(Tag tag) {
        return tagDao.insertTag(tag);
    }

    @Override
    public Tag selectTagById(Long id) {
        return tagDao.selectTagById(id);
    }

    @Override
    public Tag selectTagByName(String name) {
        return tagDao.selectTagByName(name);
    }

    @Override
    public List<Tag> selectTagList() {
        return tagDao.selectTagList();
    }

    @Override
    public int updateTag(Tag tag) {
        return tagDao.updateTag(tag);
    }

    @Override
    public int deleteTag(Long id) {
        return tagDao.deleteTag(id);
    }

    @Override
    public List<TagAndAmount> selectTagAndAmount() {
        return tagDao.selectTagAndAmount();
    }


}
